home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Collections: Camelot
/
Camelot 075 (1990-05)(Swedish User Group of Amiga)(SE)(PD)[WB].zip
/
Camelot 075 (1990-05)(Swedish User Group of Amiga)(SE)(PD)[WB].adf
/
p2c
/
README.AMIGA
< prev
next >
Wrap
Text File
|
1990-05-13
|
2KB
|
58 lines
For the Amiga version it is necessary that you have P2C: assigned to
this root directory. It must contain :
p2c
home <dir>
If home doesn't exist, then you must have a source distribution, in
which case go to the src directory and make install.
When compiling (the c file produced) with MANX, you may have to define -DAMIGA
to ensure you get the Amiga specific defines (see P2C:home/p2c/p2c.h)).
However I don't know if MANX requires these defines (I only have Lattice).
NOTE: UNIX C compilers has the function gets() flush the
stdout buffer before it executes. Amiga Lattice C doesn't do this.
This is corrected for by having a #define in P2C:home/p2c/p2c.h
that causes this behaviour. I don't know if this is needed
for MANX. Oh ya, this is the only reason that you need -DAMIGA
when compiling the c code produced.
I use a stack of 50000 (always) and I didn't have any problems with p2c. I
don't know what the minimum useable stack size is.
When compiling with Lattice 5.04 (and earlier versions as well I imagine)
do not use the -ms and -O options - they are broke and will produce bad
code with p2c. They work fine sometimes, but not here. Sigh.
In the src directory there are two files: #lint.out and #LATTICE_OPTIMIZER.OUT
Something to do (when extremely bored :-) is to remove all the lint errors
(functions, variables, etc. that aren't used - to decrease executable size).
Also, to decrease the executable size, one should put #ifdef's around all
the debug code in p2c.
In porting this to the Amiga I did the following :
1) added ifdef's to makeproto.c, p2c.h, and trans.h so that BSD not defined
2) added ifdef's to trans.h so that P2C_HOME was defined.
My version of make wouldn't let me define P2C_HOME="P2C:home".
3) broke up lex.c, parse.c, decl.c, expr.c, pexpr.c and funcs.c into
smaller files (necessary so that my compiler would compile them properly)
and updated the comments in trans.c pertaining to file names
4) added the target-type AMIGA to trans.c
5) modified the makefiles so that they would work with my make and compiler
NOTE: you really don't need to use makeproto to generate prototypes; you
could use the Lattice compiler to generate these. However, the author uses
"Static" which he ?sometimes? #define's as "static", so I use makeproto
since Lattice doesn't know about this.
The original sources can be found at csvax.caltech.edu.
G. R. Walter grwalter@watmath.waterloo.edu